package com.ifinc.common.socket.model;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * Created by IntelliJ IDEA.
 * User: luotao
 * Date: 12-5-30
 * Time: 14:11
 */
@Service
public class BaseRequest implements SckRequest{
    public static final int command_trade = 101;

    private String uuid;

    public String generateUUID(){
        String uudi = UUID.randomUUID().toString();
        setUuid(uudi);
        return uudi;
    }

    @Override
    public int getCommand() {
        return 0;
    }

    @Override
    public String getUuid() {
        return uuid;
    }

    @Override
    public void setUuid(String uuid) {
        this.uuid=uuid;
    }

    @Override
    public String object2Json() {
        return JSON.toJSONString(this);
    }
}
